<?php

use App\Models\Article\ArticleModel;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class AlterTableArticleAddPutHotTop extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('article', function (Blueprint $table) {
            $table->unsignedTinyInteger('putHotTop')->default(0)->after('putTop')
                  ->comment(enumToMigrationComment(ArticleModel::PUT_TOP_TEXT, "是否热榜置顶"));
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('article', function (Blueprint $table) {
            $table->dropColumn('putHotTop');
        });
    }
}
